<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>مدونة مبرمج مغربي</title>
	<atom:link href="http://www.bp.ma/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bp.ma</link>
	<description>مدونة برمجية اقوم باضافة اخر ما ابرمجه من برمجيات حرة ودروس واخبار تقنية</description>
	<lastBuildDate>Sat, 20 Feb 2010 10:57:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>التعامل مع الـ models في codeigniter</title>
		<link>http://www.bp.ma/2010/02/19/%d8%a7%d9%84%d8%aa%d8%b9%d8%a7%d9%85%d9%84-%d9%85%d8%b9-%d8%a7%d9%84%d9%80-models-%d9%81%d9%8a-codeigniter/</link>
		<comments>http://www.bp.ma/2010/02/19/%d8%a7%d9%84%d8%aa%d8%b9%d8%a7%d9%85%d9%84-%d9%85%d8%b9-%d8%a7%d9%84%d9%80-models-%d9%81%d9%8a-codeigniter/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 12:17:45 +0000</pubDate>
		<dc:creator>عبد الواحد البشيري</dc:creator>
				<category><![CDATA[framwork]]></category>
		<category><![CDATA[دروس برمجية]]></category>
		<category><![CDATA[codeifniter]]></category>
		<category><![CDATA[model]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[اطار عمل]]></category>
		<category><![CDATA[درس]]></category>

		<guid isPermaLink="false">http://www.bp.ma/?p=396</guid>
		<description><![CDATA[بسم الله الرحمن الرحيم
الموديل او Model وضيفته هي التحكم في البيانات الموجودة في القاعدة وهذا فقط للتنظيم  
لنعد الى موضعنا الان ... مسار الموديل هو application/models وداخله يتم وضع ملفات php باسم مثلا news_model.php ويكون على هذا المسار application/models/news_model.php
طريقة انشاء كلاس الموديل هي على الشكل التالي

PLAIN TEXT
PHP:




class News_model extends Model&#123;


&#160; &#160; 


&#160; &#160; function [...]]]></description>
			<content:encoded><![CDATA[<p>بسم الله الرحمن الرحيم</p>
<p>الموديل او Model وضيفته هي التحكم في البيانات الموجودة في القاعدة وهذا فقط للتنظيم  </p>
<p>لنعد الى موضعنا الان ... مسار الموديل هو application/models وداخله يتم وضع ملفات php باسم مثلا news_model.php ويكون على هذا المسار application/models/news_model.php<br />
طريقة انشاء كلاس الموديل هي على الشكل التالي<br />
<span id="more-396"></span></p>
<div class="igBar"><span id="lphp-11"><a href="#" onclick="javascript:showPlainTxt('php-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-11">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">class</span> News_model extends Model<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> News_model<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; parent::<span style="color:#006600;">Model</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
طيب لنفرض انه لدينا جدول اخبار في القاعدة ونريد ان ننشئ دالة تقوم بعملية اظهار الأخبار ودالة اظهار خبر واحد ودالة مسح و دالة تعديل واضافة...<br />
هذا هو التنظيم والبرمجة النظيقة والمتعة ايضا.<br />
 اذا تابع معي ...</p>
<p>سنصنع كلاس يقوم بما ذكرت انفا</p>
<div class="igBar"><span id="lphp-12"><a href="#" onclick="javascript:showPlainTxt('php-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-12">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">class</span> News_model extends Model<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//هذه الدالة ضرورية لمنداة model ويمكن استخدام دالة __construct لـ php5</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> News_model<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; parent::<span style="color:#006600;">Model</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//اظهار&nbsp; اخر عشرة اخبار مضافة</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> last_ten_news<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$tbl</span> <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$query</span>=<span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">db</span>-&gt;<span style="color:#006600;">order_by</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'id'</span>,<span style="color:#FF0000;">'desc'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$query</span>=<span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">db</span>-&gt;<span style="color:#006600;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$tbl</span>,<span style="color:#CC66CC;color:#800000;">10</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$query</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// اظهار خبر واحد بدلالة رقمه</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> news_by_id<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$tbl</span>,<span style="color:#0000FF;">$id</span> <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$query</span>=<span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">db</span>-&gt;<span style="color:#006600;">where</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'id'</span>,<span style="color:#0000FF;">$id</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$query</span>=<span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">db</span>-&gt;<span style="color:#006600;">get</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$tbl</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$query</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// اضافة بيانات الى القاعدة</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> add<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$tbl</span>,<span style="color:#0000FF;">$data</span>=<a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">db</span>-&gt;<span style="color:#006600;">insert</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$tbl</span>,<span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// تعديل البيانات بدلالة رقم الصف في القاعدة</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> edit<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$tbl</span>,<span style="color:#0000FF;">$data</span>=<a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>,<span style="color:#0000FF;">$id</span> <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">db</span>-&gt;<span style="color:#006600;">where</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'id'</span>,<span style="color:#0000FF;">$id</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">db</span>-&gt;<span style="color:#006600;">update</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$tbl</span>,<span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//يرجع عدد الصفوف التي تم مسحها في حالتنا واحد واذا اعطانا صفر فانه لم يحذف اي صف</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">db</span>-&gt;<span style="color:#006600;">affected_rows</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//مسح صف في القاعدة بدلالة رقمه</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> delete<span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$tbl</span>,<span style="color:#0000FF;">$id</span> <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">db</span>-&gt;<span style="color:#006600;">where</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'id'</span>,<span style="color:#0000FF;">$id</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">db</span>-&gt;<span style="color:#006600;">delete</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$tbl</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//يرجع عدد الصفوف التي تم مسحها في حالتنا واحد واذا اعطانا صفر فانه لم يحذف اي صف</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">return</span> <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">db</span>-&gt;<span style="color:#006600;">affected_rows</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
الأن انتهينا من ملف الموديل ونذهب لملف التحكم  لنطلب ملف الموديل ونستخدم الدوال التي كتبناها</p>
<p>ننشئ دالة داخل كلاس ملف التحكم</p>
<div class="igBar"><span id="lphp-13"><a href="#" onclick="javascript:showPlainTxt('php-13'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-13">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> insert<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// المفتاح news هو اسم الحقل في القاعدة </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$data</span>=<a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'news'</span>=&gt;<span style="color:#FF0000;">'نص الخبر هنا نص الخبر هنا'</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">news_model</span>-&gt;<span style="color:#006600;">add</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'news'</span>,<span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
دالة add تقوم بادخال البيانات الى القاعدة وترجع الينا عدد الصفوف التي تم ادخالها كما شرحت من قبل<br />
والان سنضع شرط اذا تم الادخال نطبع رسالة نجاح</p>
<div class="igBar"><span id="lphp-14"><a href="#" onclick="javascript:showPlainTxt('php-14'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-14">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> insert<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// code html</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$data</span>=<a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'news'</span>=&gt;<span style="color:#FF0000;">'نص الخبر هنا نص الخبر هنا'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">news_model</span>-&gt;<span style="color:#006600;">add</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'news'</span>,<span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#41;</span>&gt; <span style="color:#CC66CC;color:#800000;">0</span> <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'تم اضافة الخبر بنجاح'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#616100;">else</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'لم يتم اضافة اي شيئ'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
لاضافة البيانات ستطلب هذا الرابط http://localhost/index.php/news/insert<br />
كذلك يمكن استقبال مصفوفة $_POST ووضعها مكان $data عندما يتم اضافة الخبر من form</p>
<p>الأن نريد اظهار اخر عشرة اخبار تم اضافتهم وسنستخدم التي صنعناها في الموديل<br />
سيكون الكود كالتالي</p>
<div class="igBar"><span id="lphp-15"><a href="#" onclick="javascript:showPlainTxt('php-15'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-15">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> view<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//قمنا بتخزين النتائج في مصفوفة لنعرضها داخل ملف view</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'last_ten_news'</span><span style="color:#006600; font-weight:bold;">&#93;</span>=<span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">news_model</span>-&gt;<span style="color:#006600;">last_ten_news</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'news'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//اعطينا المصفوفة لملف view وسميته ب last_ten_news.php داخل مجلد /views</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">load</span>-&gt;<span style="color:#006600;">view</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'last_ten_news'</span>,<span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
وملف الـ view باسم last_ten_news.php داخل مجلد /views وسيكون بسيط كالتالي</p>
<div class="igBar"><span id="lphp-16"><a href="#" onclick="javascript:showPlainTxt('php-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-16">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$last_ten_news</span>-&gt;<span style="color:#006600;">result</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$news</span> <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;p style=<span style="color:#FF0000;">"background:silver;"</span>&gt;&lt;?php <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$news</span>-&gt;<span style="color:#006600;">news</span>; ?&gt;&lt;/p&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>والأن اذهب الى  http://localhost/index.php/news/view<br />
واذا اردنا اظهار خبر واحد يكفي ان نكتب هذه الدالة </p>
<div class="igBar"><span id="lphp-17"><a href="#" onclick="javascript:showPlainTxt('php-17'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-17">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> view_id<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$id</span>=<span style="color:#FF0000;">''</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//قمنا بتخزين النتائج في مصفوفة لنعرضها داخل ملف view</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'last_ten_news'</span><span style="color:#006600; font-weight:bold;">&#93;</span>=<span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">news_model</span>-&gt;<span style="color:#006600;">news_by_id</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'news'</span>,<span style="color:#0000FF;">$id</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//اعطينا المصفوفة لملف view وسميته ب last_ten_news.php داخل مجلد /views</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">load</span>-&gt;<span style="color:#006600;">view</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'last_ten_news'</span>,<span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
ونطلب الخبر عن طريق الرابط http://localhost/index.php/news/view_id/1</p>
<p>الأن لحذف اي صف من صفوف الجدول في القاعدة سنستخدم دالة الحذف وتكون كالتالي</p>
<div class="igBar"><span id="lphp-18"><a href="#" onclick="javascript:showPlainTxt('php-18'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-18">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> delete<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$id</span>=<span style="color:#FF0000;">''</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">news_model</span>-&gt;<span style="color:#006600;">delete</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'news'</span>,<span style="color:#0000FF;">$id</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'تم المسح بنجاح '</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#616100;">else</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'لم يتم المسح او انه غير موجود'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
طبعا سيتم حفظ الكود داخل ملف التحكم news وسيتم منادة الرابط http://localhost/index.php/news/delete/1<br />
غير رقم واحد الى اي رقم صف في القادة وسيتم حذفه</p>
<p>الأن مع التعديل</p>
<div class="igBar"><span id="lphp-19"><a href="#" onclick="javascript:showPlainTxt('php-19'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-19">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">function</span> edit<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$id</span>=<span style="color:#FF0000;">''</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$id</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#0000FF;">$data</span>=<a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'news'</span>=&gt;<span style="color:#FF0000;">'تعديل النص من جديد'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">news_model</span>-&gt;<span style="color:#006600;">edit</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'news'</span>,<span style="color:#0000FF;">$data</span>,<span style="color:#0000FF;">$id</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'تم التعديل بنجاح '</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#616100;">else</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'لم يتم التعديل'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
لاحظت انني اضفت مدخل لكل من الدوال  delete و view_id و edit باسم $id<br />
نعم انه الرقم الذي نكتبه في الرابط يتم التعرف عليه تلقائيا </p>
<p>http://localhost/index.php/news/delete/1</p>
<p>وفي الأخير سيكون شكل ملف التحكم </p>
<div class="igBar"><span id="lphp-20"><a href="#" onclick="javascript:showPlainTxt('php-20'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-20">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">class</span> News extends Controller<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> News<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; parent::<span style="color:#006600;">Controller</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#FF9933; font-style:italic;">// نقوم بطلب قاعدة البيانات</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">load</span>-&gt;<span style="color:#006600;">database</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#FF9933; font-style:italic;">// نطلب ملف الموديل</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">load</span>-&gt;<span style="color:#006600;">model</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'news_model'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color:#000000; font-weight:bold;">function</span> index<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> view<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//قمنا بتخزين النتائج في مصفوفة لنعرضها داخل ملف view</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'last_ten_news'</span><span style="color:#006600; font-weight:bold;">&#93;</span>=<span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">news_model</span>-&gt;<span style="color:#006600;">last_ten_news</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'news'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//اعطينا المصفوفة لملف view وسميته ب last_ten_news.php داخل مجلد /views</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">load</span>-&gt;<span style="color:#006600;">view</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'last_ten_news'</span>,<span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp;<span style="color:#000000; font-weight:bold;">function</span> view_id<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$id</span>=<span style="color:#FF0000;">''</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//قمنا بتخزين النتائج في مصفوفة لنعرضها داخل ملف view</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'last_ten_news'</span><span style="color:#006600; font-weight:bold;">&#93;</span>=<span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">news_model</span>-&gt;<span style="color:#006600;">news_by_id</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'news'</span>,<span style="color:#0000FF;">$id</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">//اعطينا المصفوفة لملف view وسميته ب last_ten_news.php داخل مجلد /views</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">load</span>-&gt;<span style="color:#006600;">view</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'last_ten_news'</span>,<span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> insert<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// code html</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$data</span>=<a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'news'</span>=&gt;<span style="color:#FF0000;">'نص الخبر هنا نص الخبر هنا'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">news_model</span>-&gt;<span style="color:#006600;">add</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'news'</span>,<span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#41;</span>&gt; <span style="color:#CC66CC;color:#800000;">0</span> <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'تم اضافة الخبر بنجاح'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#616100;">else</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'لم يتم اضافة اي شيئ'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> delete<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$id</span>=<span style="color:#FF0000;">''</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">news_model</span>-&gt;<span style="color:#006600;">delete</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'news'</span>,<span style="color:#0000FF;">$id</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'تم المسح بنجاح '</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#616100;">else</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'لم يتم المسح او انه غير موجود'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> edit<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$id</span>=<span style="color:#FF0000;">''</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color:#0000FF;">$data</span>=<a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'news'</span>=&gt;<span style="color:#FF0000;">'تعديل النص من جديد'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span> <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">news_model</span>-&gt;<span style="color:#006600;">edit</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'news'</span>,<span style="color:#0000FF;">$data</span>,<span style="color:#0000FF;">$id</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'تم التعديل بنجاح '</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#616100;">else</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'لم يتم التعديل'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>درسنا القادم سيتكلم عن <del datetime="2010-02-20T10:57:54+00:00">الكائن db</del> المكتبات في codeigniter وجميع استخداماته والذي يسهل عليك الكثير من الوقت </p>
<p>هذا فان اصبت فمن الله عز وجل وان اخطات فمن نفسي ومن الشيطان</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bp.ma/2010/02/19/%d8%a7%d9%84%d8%aa%d8%b9%d8%a7%d9%85%d9%84-%d9%85%d8%b9-%d8%a7%d9%84%d9%80-models-%d9%81%d9%8a-codeigniter/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>الثوابت او define في php</title>
		<link>http://www.bp.ma/2010/02/18/%d8%a7%d9%84%d8%ab%d9%88%d8%a7%d8%a8%d8%aa-%d8%a7%d9%88-define-%d9%81%d9%8a-php/</link>
		<comments>http://www.bp.ma/2010/02/18/%d8%a7%d9%84%d8%ab%d9%88%d8%a7%d8%a8%d8%aa-%d8%a7%d9%88-define-%d9%81%d9%8a-php/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 10:12:35 +0000</pubDate>
		<dc:creator>عبد الواحد البشيري</dc:creator>
				<category><![CDATA[php  البي اتش بي]]></category>
		<category><![CDATA[دروس برمجية]]></category>
		<category><![CDATA[define]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[ثابت]]></category>
		<category><![CDATA[ثوابت]]></category>

		<guid isPermaLink="false">http://www.bp.ma/?p=392</guid>
		<description><![CDATA[بسم الله الرحمن الرحيم
الثوابت تقوم بتخزين قيمة مثلها مثل المتغيرات ولكن من خلال اسم 'ثابت' يتبادر الى ذهننا ان الثابت لا يتغير عكس المتغير الذي يتغير كلما اعطيته قيمة جديدة
بمعنى اننا اذا انشأنا ثابتا لا نستطيع اضافة ثابت اخر بنفس الاسم كما انه حساس لحالة الأحرف الا اذا اضفنا اليه مدخل true ..  اعرف [...]]]></description>
			<content:encoded><![CDATA[<p>بسم الله الرحمن الرحيم</p>
<p>الثوابت تقوم بتخزين قيمة مثلها مثل المتغيرات ولكن من خلال اسم 'ثابت' يتبادر الى ذهننا ان الثابت لا يتغير عكس المتغير الذي يتغير كلما اعطيته قيمة جديدة<br />
بمعنى اننا اذا انشأنا ثابتا لا نستطيع اضافة ثابت اخر بنفس الاسم كما انه حساس لحالة الأحرف الا اذا اضفنا اليه مدخل true ..  اعرف ان هذا غير مفهوم ولكنك ستفهم من خلال الأمثلة<br />
<span id="more-392"></span></p>
<div class="igBar"><span id="lphp-26"><a href="#" onclick="javascript:showPlainTxt('php-26'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-26">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/define"><span style="color:#000066;">define</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'NAME'</span>,<span style="color:#FF0000;">'abdelouahid elbachiri'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
اذا اردنا طباعة الثابت يكفي ان تكتب</p>
<div class="igBar"><span id="lphp-27"><a href="#" onclick="javascript:showPlainTxt('php-27'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-27">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> NAME;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>ولكن مذا لو نسيت وكتبت الثابت بأحرف صغيرة مع اننا عندما انشأنا الثابت اعطينه اسم بالحروف الكبيرة</p>
<div class="igBar"><span id="lphp-28"><a href="#" onclick="javascript:showPlainTxt('php-28'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-28">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> name;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
سيطبع رسالة انه غير موجود ويطبع معه اسم name بكل بساطة<br />
اذا هل يوجد حل ؟ ,, بالطبع لغة بي اتش بي مليئة بالحلول  والسهولة<br />
  وكما قلت من قبل سنضيف الي الثابت مدخل اخر وسيكون الثابت هكذا</p>
<div class="igBar"><span id="lphp-29"><a href="#" onclick="javascript:showPlainTxt('php-29'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-29">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/define"><span style="color:#000066;">define</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'NAME'</span>,<span style="color:#FF0000;">'abdelouahid elbachiri'</span>,<span style="color:#000000; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p> </p>
<p>والأن قم بكتابة اسم الثابت كما تشاء</p>
<p>لماذا استخدم الثوابت ومتى ؟</p>
<p>ان استخدام الثوابت يقلل من استهلاك الذاكرة وغالبا ما يتم استخدامها في ملفات اللغة  وعلى حسب كل برنامج ترى انه من مصلحته ان يستخدم الثابت</p>
<p>يمكن انشاء الثابت بهذه الطريقة ادناه على php 5.3.0</p>
<div class="igBar"><span id="lphp-30"><a href="#" onclick="javascript:showPlainTxt('php-30'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-30">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">const NAME =<span style="color:#FF0000;">'abdelouahid elbachiri'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> NAME;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>هذا فان اصبت فمن الله عز وجل وان اخطأت فمن نفسي ومن الشيطان</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bp.ma/2010/02/18/%d8%a7%d9%84%d8%ab%d9%88%d8%a7%d8%a8%d8%aa-%d8%a7%d9%88-define-%d9%81%d9%8a-php/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>كيفية الاتصال بالموديم zte mf100 على ubuntu</title>
		<link>http://www.bp.ma/2010/02/15/%d9%83%d9%8a%d9%81%d9%8a%d8%a9-%d8%a7%d9%84%d8%a7%d8%aa%d8%b5%d8%a7%d9%84-%d8%a8%d8%a7%d9%84%d9%85%d9%88%d8%af%d9%8a%d9%85-zte-mf100-%d8%b9%d9%84%d9%89-ubuntu/</link>
		<comments>http://www.bp.ma/2010/02/15/%d9%83%d9%8a%d9%81%d9%8a%d8%a9-%d8%a7%d9%84%d8%a7%d8%aa%d8%b5%d8%a7%d9%84-%d8%a8%d8%a7%d9%84%d9%85%d9%88%d8%af%d9%8a%d9%85-zte-mf100-%d8%b9%d9%84%d9%89-ubuntu/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 20:58:09 +0000</pubDate>
		<dc:creator>عبد الواحد البشيري</dc:creator>
				<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[maroc telecom]]></category>
		<category><![CDATA[mf100]]></category>
		<category><![CDATA[modem]]></category>
		<category><![CDATA[zte]]></category>
		<category><![CDATA[zte mf100]]></category>

		<guid isPermaLink="false">http://www.bp.ma/?p=387</guid>
		<description><![CDATA[بسم اله الرحمن الرحيم
بما انني استخدم في الوقت الحالي  موديم zte mf100 على اوبونتو وذلك بعد بحث مضني توصلت الى الحل عبر منتدى ابونتو 
تحديث: فبراير 20, 2010
لكي يعمل الموديم بدون مشاكل قم باستخدام الموديم على ويندوز وسيتم تنصيب برنامج الاتصال بشكل الي وبعده اذهب الى اعدادات البرنامج وقم بالغاء كلمة المرور وبعده استخدمه [...]]]></description>
			<content:encoded><![CDATA[<p>بسم اله الرحمن الرحيم<br />
بما انني استخدم في الوقت الحالي  موديم zte mf100 على اوبونتو وذلك بعد بحث مضني توصلت الى الحل عبر منتدى ابونتو </p>
<p><strong>تحديث: فبراير 20, 2010</strong><br />
<em>لكي يعمل الموديم بدون مشاكل قم باستخدام الموديم على ويندوز وسيتم تنصيب برنامج الاتصال بشكل الي وبعده اذهب الى اعدادات البرنامج وقم بالغاء كلمة المرور وبعده استخدمه على ابونتو </em><br />
اولا نقوم بتنصيب   wvdial<br />
 اذا لم يكن موجود من قبل<br />
<a href="http://www.multiupload.com/B0JX371U2U">حمله من هنا</a>  وقم بتنصيب جميع ما يوجد في الأرشيف وذلك ضروري</p>
<p>بعد تنصيب wvdial سنقوم بفتح terminal ونكتب هذا الأمر<br />
<span id="more-387"></span></p>
<div class="igBar"><span id="lcode-38"><a href="#" onclick="javascript:showPlainTxt('code-38'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-38">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sudo gedit&nbsp; /etc/wvdial.<span style="">conf</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
سيفتح لك برنامج تحرير النصوص اذا كان يوجد فيه اي شيئ قم بمسحه وضع مكانه هذا الكود</p>
<div class="igBar"><span id="lcode-39"><a href="#" onclick="javascript:showPlainTxt('code-39'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-39">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#91;</span>Dialer Defaults<span style="color:#006600; font-weight:bold;">&#93;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Init = ATZ</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Init2 = AT+CFUN=<span style="color:#800000;color:#800000;">1</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Init3 = ATQ0 V1 E1 S0=<span style="color:#800000;color:#800000;">0</span> &amp;C1 &amp;D2 +FCLASS=<span style="color:#800000;color:#800000;">0</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Init4 = AT+CGDCONT=<span style="color:#800000;color:#800000;">1</span>,<span style="color:#CC0000;">"IP"</span>,<span style="color:#CC0000;">"www.iamgprs2.ma"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Abort on No Dialtone = on</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">New PPPD = yes</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Password = adgj</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Check Def Route = on</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Phone = *<span style="color:#800000;color:#800000;">99</span>#</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Idle Seconds = <span style="color:#800000;color:#800000;">0</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Abort on Busy = off</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Modem Type = USB Modem</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Stupid Mode = on</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Baud = <span style="color:#800000;color:#800000;">9600</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Auto DNS = off</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Dial Command = ATM1L3DT</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Auto Reconnect = off</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Ask Password = off</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ISDN = off</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Dial Attempts = <span style="color:#800000;color:#800000;">1</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Username = gprs</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Carrier Check = on</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Modem = /dev/ttyUSB2 </div>
</li>
</ol>
</div>
</div>
</div>
<p>
قم بحفظ الملف واغلق البرنامج<br />
هذ الكود يعمل فقط لاتصالات المغرب اذا كنت مشترك مع شركة اخرى غير www.iamgprs2.ma الى dns حسب الشركة ....</p>
<p>الأن اكتب هذا الأمر في terminal</p>
<div class="igBar"><span id="lcode-40"><a href="#" onclick="javascript:showPlainTxt('code-40'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-40">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sudo gedit /etc/usb_modeswitch.<span style="">conf</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
سيفتح لك برنامج تحرير النصوص وضع فيه هذ الكود</p>
<div class="igBar"><span id="lcode-41"><a href="#" onclick="javascript:showPlainTxt('code-41'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-41">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#ZTE MF100</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"># Contributor: www.<span style="">bp</span>.<span style="">ma</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">DefaultVendor=&nbsp; 0x19d2</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">DefaultProduct= 0x2000</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">TargetVendor=&nbsp; &nbsp;0x19d2</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">TargetProduct=&nbsp; 0x0031</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">MessageEndpoint=0x01</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">MessageContent=<span style="color:#CC0000;">"55534243123456782000000080000c85010101180101010101000000000000"</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
قم بحفظه واغلقه<br />
الان اكتب في terminal </p>
<div class="igBar"><span id="lcode-42"><a href="#" onclick="javascript:showPlainTxt('code-42'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-42">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sudo gedit /etc/udev/rules.<span style="">d</span>/<span style="color:#800000;color:#800000;">95</span>-ZTE-MF100.<span style="">rules</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
وضع فيه هذا الكود</p>
<div class="igBar"><span id="lcode-43"><a href="#" onclick="javascript:showPlainTxt('code-43'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-43">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">SUBSYSTEM==<span style="color:#CC0000;">"usb"</span>, SYSFS<span style="color:#006600; font-weight:bold;">&#123;</span>idProduct<span style="color:#006600; font-weight:bold;">&#125;</span>==<span style="color:#CC0000;">"2000"</span>, SYSFS<span style="color:#006600; font-weight:bold;">&#123;</span>idVendor<span style="color:#006600; font-weight:bold;">&#125;</span>==<span style="color:#CC0000;">"19d2"</span>, RUN+=<span style="color:#CC0000;">"/usr/local/sbin/usb_modeswitch"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">SUBSYSTEM==<span style="color:#CC0000;">"usb"</span>, SYSFS<span style="color:#006600; font-weight:bold;">&#123;</span>idProduct<span style="color:#006600; font-weight:bold;">&#125;</span>==<span style="color:#CC0000;">"0031"</span>, SYSFS<span style="color:#006600; font-weight:bold;">&#123;</span>idVendor<span style="color:#006600; font-weight:bold;">&#125;</span>==<span style="color:#CC0000;">"19d2"</span>, RUN+=<span style="color:#CC0000;">"/bin/sleep 5"</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">SUBSYSTEM==<span style="color:#CC0000;">"usb"</span>, SYSFS<span style="color:#006600; font-weight:bold;">&#123;</span>idProduct<span style="color:#006600; font-weight:bold;">&#125;</span>==<span style="color:#CC0000;">"0031"</span>, SYSFS<span style="color:#006600; font-weight:bold;">&#123;</span>idVendor<span style="color:#006600; font-weight:bold;">&#125;</span>==<span style="color:#CC0000;">"19d2"</span>, RUN+=<span style="color:#CC0000;">"/sbin/modprobe usbserial vendor=0x19d2 product=0x0031"</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>والأن اكتب في terminal </p>
<div class="igBar"><span id="lcode-44"><a href="#" onclick="javascript:showPlainTxt('code-44'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-44">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">sudo wvdial </div>
</li>
</ol>
</div>
</div>
</div>
<p>
وتمتع بالأنترنيت<br />
بعض الحلول اخذتها من منتدى ubuntu وخصوصا من<a href="http://forum.ubuntu-fr.org/profile.php?id=147780"> العضو</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bp.ma/2010/02/15/%d9%83%d9%8a%d9%81%d9%8a%d8%a9-%d8%a7%d9%84%d8%a7%d8%aa%d8%b5%d8%a7%d9%84-%d8%a8%d8%a7%d9%84%d9%85%d9%88%d8%af%d9%8a%d9%85-zte-mf100-%d8%b9%d9%84%d9%89-ubuntu/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>مشاكل الاتصال بالأنترنيت عن طريق موديم 3G</title>
		<link>http://www.bp.ma/2010/02/14/%d9%85%d8%b4%d8%a7%d9%83%d9%84-%d8%a7%d9%84%d8%a7%d8%aa%d8%b5%d8%a7%d9%84-%d8%a8%d8%a7%d9%84%d8%a3%d9%86%d8%aa%d8%b1%d9%86%d9%8a%d8%aa-%d8%b9%d9%86-%d8%b7%d8%b1%d9%8a%d9%82-%d9%85%d9%88%d8%af%d9%8a/</link>
		<comments>http://www.bp.ma/2010/02/14/%d9%85%d8%b4%d8%a7%d9%83%d9%84-%d8%a7%d9%84%d8%a7%d8%aa%d8%b5%d8%a7%d9%84-%d8%a8%d8%a7%d9%84%d8%a3%d9%86%d8%aa%d8%b1%d9%86%d9%8a%d8%aa-%d8%b9%d9%86-%d8%b7%d8%b1%d9%8a%d9%82-%d9%85%d9%88%d8%af%d9%8a/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 12:03:40 +0000</pubDate>
		<dc:creator>عبد الواحد البشيري</dc:creator>
				<category><![CDATA[القسم العام]]></category>
		<category><![CDATA[3G modem wana maroc telecom]]></category>

		<guid isPermaLink="false">http://www.bp.ma/2010/02/14/%d9%85%d8%b4%d8%a7%d9%83%d9%84-%d8%a7%d9%84%d8%a7%d8%aa%d8%b5%d8%a7%d9%84-%d8%a8%d8%a7%d9%84%d8%a3%d9%86%d8%aa%d8%b1%d9%86%d9%8a%d8%aa-%d8%b9%d9%86-%d8%b7%d8%b1%d9%8a%d9%82-%d9%85%d9%88%d8%af%d9%8a/</guid>
		<description><![CDATA[السلام عليكم
بعد انتهاء فترة الرصيد لدى موديم باين  قررت تغيير الشركة واشتريت موديم اتصالات المغرب من نوع zte mf100  ولكنني تفجأت بالبطئ الشديد مع ان ثمن الاشتراك الشهري اغلى من الموديم السابق 
الموديم السابق كانت سرعته احسن من الحالي ومع دلك قررت ان اغير وانصدمت بالجديد
انصح الجميع ادا اراد ان يشتري موديم جديد [...]]]></description>
			<content:encoded><![CDATA[<p>السلام عليكم</p>
<p>بعد انتهاء فترة الرصيد لدى موديم باين  قررت تغيير الشركة واشتريت موديم اتصالات المغرب من نوع zte mf100  ولكنني تفجأت بالبطئ الشديد مع ان ثمن الاشتراك الشهري اغلى من الموديم السابق </p>
<p>الموديم السابق كانت سرعته احسن من الحالي ومع دلك قررت ان اغير وانصدمت بالجديد</p>
<p>انصح الجميع ادا اراد ان يشتري موديم جديد ان ي>هب مباشرة الى شركة "وانا" ليس اشهارا ولكن عن تجربة </p>
]]></content:encoded>
			<wfw:commentRss>http://www.bp.ma/2010/02/14/%d9%85%d8%b4%d8%a7%d9%83%d9%84-%d8%a7%d9%84%d8%a7%d8%aa%d8%b5%d8%a7%d9%84-%d8%a8%d8%a7%d9%84%d8%a3%d9%86%d8%aa%d8%b1%d9%86%d9%8a%d8%aa-%d8%b9%d9%86-%d8%b7%d8%b1%d9%8a%d9%82-%d9%85%d9%88%d8%af%d9%8a/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>التعامل مع ملفات التصميم في codeigniter</title>
		<link>http://www.bp.ma/2010/02/05/%d8%a7%d9%84%d8%aa%d8%b9%d8%a7%d9%85%d9%84-%d9%85%d8%b9-%d9%85%d9%84%d9%81%d8%a7%d8%aa-%d8%a7%d9%84%d8%aa%d8%b5%d9%85%d9%8a%d9%85-%d9%81%d9%8a-codeigniter/</link>
		<comments>http://www.bp.ma/2010/02/05/%d8%a7%d9%84%d8%aa%d8%b9%d8%a7%d9%85%d9%84-%d9%85%d8%b9-%d9%85%d9%84%d9%81%d8%a7%d8%aa-%d8%a7%d9%84%d8%aa%d8%b5%d9%85%d9%8a%d9%85-%d9%81%d9%8a-codeigniter/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 17:48:48 +0000</pubDate>
		<dc:creator>عبد الواحد البشيري</dc:creator>
				<category><![CDATA[framwork]]></category>
		<category><![CDATA[دروس برمجية]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[اطار عمل]]></category>

		<guid isPermaLink="false">http://www.bp.ma/?p=381</guid>
		<description><![CDATA[بسم الله الرحمن الرحيم
سأبين في هذا الدرس كيف يتم التعامل مع القوالب او ملفات التصميم من خلال ال CONTROLLER
لكي نقوم باظهار نص داخل قالب ما عن طريق المتحكم
سننشئ ملف ونسميه بـ phonebook.php وسنجعله عبارة عن دليل الهاتف ويكون داخل مجلد /application/controllers
ونكتب داخله الشفرة التالية

PLAIN TEXT
PHP:




&#60;?php


class Phonebook extends controller&#123;


&#160; &#160; function Phonebook&#40;&#41;&#123;


&#160; &#160; &#160; &#160; parent::controller&#40;&#41;;


&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>بسم الله الرحمن الرحيم</p>
<p>سأبين في هذا الدرس كيف يتم التعامل مع القوالب او ملفات التصميم من خلال ال CONTROLLER<br />
لكي نقوم باظهار نص داخل قالب ما عن طريق المتحكم<br />
سننشئ ملف ونسميه بـ phonebook.php وسنجعله عبارة عن دليل الهاتف ويكون داخل مجلد /application/controllers<br />
ونكتب داخله الشفرة التالية<br />
<span id="more-381"></span></p>
<div class="igBar"><span id="lphp-47"><a href="#" onclick="javascript:showPlainTxt('php-47'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-47">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">class</span> Phonebook extends controller<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> Phonebook<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; parent::<span style="color:#006600;">controller</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> index<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// هنا يتم طباعة الصفحة الرئيسية لـ phonebook</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> view<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'phonebook'</span><span style="color:#006600; font-weight:bold;">&#93;</span>=<a href="http://www.php.net/array"><span style="color:#000066;">array</span></a><span style="color:#006600; font-weight:bold;">&#40;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF0000;">'احمد'</span>=&gt;<span style="color:#FF0000;">'342342353453'</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; ,<span style="color:#FF0000;">'محمد'</span>=&gt;<span style="color:#FF0000;">'34531231'</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; ,<span style="color:#FF0000;">'عبد الواحد'</span>=&gt;<span style="color:#FF0000;">'4554545'</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; ,<span style="color:#FF0000;">'عبد القادر'</span>=&gt;<span style="color:#FF0000;">'232323232'</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; ,<span style="color:#FF0000;">'طارق'</span>=&gt;<span style="color:#FF0000;">'865348903'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// نقوم بجلب ملف التصميم لكي يتم طباعة البيانات داخل جدول </span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#0000FF;">$this</span>-&gt;<span style="color:#006600;">load</span>-&gt;<span style="color:#006600;">view</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'phone_table'</span>,<span style="color:#0000FF;">$data</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p>
طيب هناك شيئ غير مفهوم ... نعم انه phone_table ... حسنا هذا الأسم هو ملف التصميم الذي تحدثنا عليه ويكون في الأصل بامتداد .php<br />
يجب ان نذهب سريعا الى application/views وننشئ دخاله ملف phone_table.php ويكون بداخله هذه الكود</p>
<div class="igBar"><span id="lphp-48"><a href="#" onclick="javascript:showPlainTxt('php-48'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-48">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;table width=<span style="color:#FF0000;">"50%"</span> border=<span style="color:#FF0000;">"0"</span> cellspacing=<span style="color:#FF0000;">"1"</span> cellpadding=<span style="color:#FF0000;">"1"</span> style=<span style="color:#FF0000;">"direction:rtl;background:#E9ABAB"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;tr style=<span style="color:#FF0000;">"background:#A57B7B"</span>&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;الاسم &lt;/td&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;رقم الهاتف&lt;/td&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;/tr&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <span style="color:#616100;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$phonebook</span> <span style="color:#616100;">as</span> <span style="color:#0000FF;">$name</span> =&gt; <span style="color:#0000FF;">$number</span><span style="color:#006600; font-weight:bold;">&#41;</span> : <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;tr style=<span style="color:#FF0000;">"background:#F77777"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;?=<span style="color:#0000FF;">$name</span>;?&gt;&lt;/td&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &lt;td&gt;&lt;?=<span style="color:#0000FF;">$number</span>;?&gt;&lt;/td&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;/tr&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> endforeach; <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/table&gt; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>وستكون النتيجة هكذا</p>
<table width="50%" border="0" cellspacing="1" cellpadding="1" style="direction:rtl;background:#E9ABAB">
<tr style="background:#A57B7B">
<td>الاسم </td>
<td>رقم الهاتف</td>
</tr>
<tr style="background:#F77777">
<td>احمد</td>
<td>342342353453</td>
</tr>
<tr style="background:#F77777">
<td>محمد</td>
<td>34531231</td>
</tr>
<tr style="background:#F77777">
<td>عبد الواحد</td>
<td>4554545</td>
</tr>
<tr style="background:#F77777">
<td>عبد القادر</td>
<td>232323232</td>
</tr>
<tr style="background:#F77777">
<td>طارق</td>
<td>865348903</td>
</tr>
</table>
<p> هذه طريقة بسيطة جدا لتتعرف على كيفية التعامل مع ملفات التصميم </p>
<p>لكن لا تخف فان هذا الاطار يوفر لك اخي المبرمج على ادوات تساعدك في بناء برامجك في اقل مما تتوقعه وذلك عن طريق المكتبات والدوال التي تأتي مع المنصة كل ذلك سنتكلم عليه في الدروس القادمة ان شاء الله</p>
<p>هذا فان اصبت فمن الله عز وجل وان اخطأت فمن نفسي ومن الشيطان</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bp.ma/2010/02/05/%d8%a7%d9%84%d8%aa%d8%b9%d8%a7%d9%85%d9%84-%d9%85%d8%b9-%d9%85%d9%84%d9%81%d8%a7%d8%aa-%d8%a7%d9%84%d8%aa%d8%b5%d9%85%d9%8a%d9%85-%d9%81%d9%8a-codeigniter/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>اول برنامج لك بواسطة codeigniter</title>
		<link>http://www.bp.ma/2010/02/05/%d8%a7%d9%88%d9%84-%d8%a8%d8%b1%d9%86%d8%a7%d9%85%d8%ac-%d9%84%d9%83-%d8%a8%d9%88%d8%a7%d8%b3%d8%b7%d8%a9-codeigniter/</link>
		<comments>http://www.bp.ma/2010/02/05/%d8%a7%d9%88%d9%84-%d8%a8%d8%b1%d9%86%d8%a7%d9%85%d8%ac-%d9%84%d9%83-%d8%a8%d9%88%d8%a7%d8%b3%d8%b7%d8%a9-codeigniter/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 11:04:34 +0000</pubDate>
		<dc:creator>عبد الواحد البشيري</dc:creator>
				<category><![CDATA[framwork]]></category>
		<category><![CDATA[دروس برمجية]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[اطار عمل]]></category>

		<guid isPermaLink="false">http://www.bp.ma/?p=377</guid>
		<description><![CDATA[بسم الله الرحمن الرحيم
في  هذا الدرس سأشرح كيفية انشاء اول برنامج على المنصة
قبل الذهاب الى الشفرات البرمجة سأشرح لك بعض الأمور التي لابد من معرفتها قبل البدء
كما قلنا سابقا ان النظام مبني على تقنية MVC واعتقد أنك قرأت عنه ولو القليل ...
m = Model
v = View
c= Controller
عندما تدخل على مجلد system وتدخل ايضا على [...]]]></description>
			<content:encoded><![CDATA[<p>بسم الله الرحمن الرحيم</p>
<p>في  هذا الدرس سأشرح كيفية انشاء اول برنامج على المنصة</p>
<p>قبل الذهاب الى الشفرات البرمجة سأشرح لك بعض الأمور التي لابد من معرفتها قبل البدء</p>
<p>كما قلنا سابقا ان النظام مبني على تقنية MVC واعتقد أنك قرأت عنه ولو القليل ...<br />
m = Model<br />
v = View<br />
c= Controller</p>
<p>عندما تدخل على مجلد system وتدخل ايضا على application ستجد ان هناك مجلدات ومن بينها التي ذكرتها في الأعلى .. مجلد Model يتم وضع فيه ملفاتك البرمجية التي تقوم بعمليات مع قاعدة البيانات ومجلد view تضع فيه ملفات التصميم اما مجلد Controller فيتم وضع فيه ملفات التحكم في البرنامج وسيتم شرح كل نقطة ...</p>
<p>حسنا في ملفك البرمجي الذي ستنشئه داخل مجلد التحكم controllers سيكون عبارة عن كلاس وبداخله دوال ...<br />
اسم الكلاس سيكون في الرابط هكذا http://youSite.com/index.php/class_name واسم الدالة يأتي بعد الكلاس هكذا </p>
<p>http://youSite.com/index.php/class_name/function_name</p>
<p>طيب الان سنذهب الى مجلد system/application/controllers وننشئ ملف باسم news.php وننشئ داخله كلاس بنفس اسم الملف وهذا ضروري جدا<br />
وتكون الشفرة هكذا</p>
<div class="igBar"><span id="lphp-52"><a href="#" onclick="javascript:showPlainTxt('php-52'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-52">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// يجب كتابة اول حرف من اسم الكلاس كبير كما هو موجود تحت</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">class</span> News extends Controller<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// هذه الدالة يجب وضعها دائما في الأول اذا كنت تستخدم php4 اما اذا كنت تستخدم php5 فاستخدم</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// دالة __construct مكان News ووضيفتهما هي جلب المتحكم بمجرد طلب الصفحة وهذا ضروري</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> News<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; parent::<span style="color:#006600;">Controller</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> index<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'مرحبا بكم في اول برنامج لي '</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>الأن يمكنك طلب الكلاس بهذه الطريقة http://youSite.com/index.php/news وستجد العبارة الترحيبية امامك <img src='http://www.bp.ma/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
كذالك تستطيع جلبها هكذا http://youSite.com/index.php/news/index<br />
الأن نريد ان يكون الرابط هكذا http://youSite.com/index.php/news/view بكل بساطة سنضيف دالة اخرى تحت دالة index وتكون هكذا</p>
<div class="igBar"><span id="lphp-53"><a href="#" onclick="javascript:showPlainTxt('php-53'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-53">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// يجب كتابة اول حرف من اسم الكلاس كبير كما هو موجود تحت</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">class</span> News extends Controller<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> News<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; parent::<span style="color:#006600;">Controller</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> index<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'مرحبا بكم في اول برنامج لي '</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> view<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'مرحبا بك الى صفحة اظهار الأخبار'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// وهنا تقوم بعملية جلب البيانات من القاعدة وطباعتها</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>طيب الأن نريد مثلا اظهار خبر واحد بدلالة رقمه سيكون الرابط هكذا 12/http://youSite.com/index.php/news/view<br />
ونجعل دالة view تأخذ براميتر ID وتكون الدالة هكذا</p>
<p>نتحقق من   المعرف ID اذا كان فارغا نقوم بادراج الأخبار ,, اي المقتتطفات كما تحب</p>
<p> واما اذا كان رقما سنتحقق منه ونستخرج من القاعدة خبرا يحمل نفس الرقم </p>
<div class="igBar"><span id="lphp-54"><a href="#" onclick="javascript:showPlainTxt('php-54'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-54">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#FF9933; font-style:italic;">// يجب كتابة اول حرف من اسم الكلاس كبير كما هو موجود تحت</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">class</span> News extends Controller<span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> News<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; parent::<span style="color:#006600;">Controller</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> index<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#FF0000;">'مرحبا بكم في اول برنامج لي '</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#000000; font-weight:bold;">function</span> view<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$ID</span>=<span style="color:#FF0000;">''</span><span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#616100;">if</span><span style="color:#006600; font-weight:bold;">&#40;</span> <a href="http://www.php.net/empty"><span style="color:#000066;">empty</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$ID</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// سنقوم بطباعة عناوين الأخبار</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#616100;">else</span><span style="color:#006600; font-weight:bold;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#FF9933; font-style:italic;">// نتحقق من الرقم ونقوم بطباعة الخبر الذي يحمل نفس الرقم</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span style="color:#000066;">echo</span></a> <span style="color:#0000FF;">$ID</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color:#006600; font-weight:bold;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#006600; font-weight:bold;">&#125;</span> </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>عندما تقوم بزيارة الرابط http://yourSite.com/index.php يتم اظهار المتحكم welcome  بشكل ألي لتجنب اظهاره سنذهب الى ملف<br />
system/application/config/routes.php وتذهب الى السطر 43 وتقم بتغيير welcome الى المتحكم الذي تريده ان يظهر في الصفحة الأولى<br />
لنقل اننا نريد اظهار news</p>
<p>هذا فان اصبت فمن الله عز وجل وان اخطأت فمن نفسي ومن الشيطان</p>
<p>الدرس القادم سأبين كيفية اظهار البيانات باستخدام ملفات التصميم التي توضع في مجلد view</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bp.ma/2010/02/05/%d8%a7%d9%88%d9%84-%d8%a8%d8%b1%d9%86%d8%a7%d9%85%d8%ac-%d9%84%d9%83-%d8%a8%d9%88%d8%a7%d8%b3%d8%b7%d8%a9-codeigniter/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>كن محترفا في لغة php مع اطار العمل codeigniter</title>
		<link>http://www.bp.ma/2010/02/05/%d9%83%d9%86-%d9%85%d8%ad%d8%aa%d8%b1%d9%81%d8%a7-%d9%81%d9%8a-%d9%84%d8%ba%d8%a9-php-%d9%85%d8%b9-%d8%a7%d8%b7%d8%a7%d8%b1-%d8%a7%d9%84%d8%b9%d9%85%d9%84-codeigniter/</link>
		<comments>http://www.bp.ma/2010/02/05/%d9%83%d9%86-%d9%85%d8%ad%d8%aa%d8%b1%d9%81%d8%a7-%d9%81%d9%8a-%d9%84%d8%ba%d8%a9-php-%d9%85%d8%b9-%d8%a7%d8%b7%d8%a7%d8%b1-%d8%a7%d9%84%d8%b9%d9%85%d9%84-codeigniter/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 09:32:46 +0000</pubDate>
		<dc:creator>عبد الواحد البشيري</dc:creator>
				<category><![CDATA[framwork]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[اطار عمل]]></category>

		<guid isPermaLink="false">http://www.bp.ma/?p=375</guid>
		<description><![CDATA[بسم الله الرحمن الرحيم والصلاة والسلام على اشرف المرسلين اما بعد :
مقدمة:
موضوعنا اليوم وهو يعتبر  مقدمة يتحدث عن اطار العمل على لغة php المسمى بــ codeigniter والذي يسهل على المبرمج عملية كتابة الأكواد وعدم تكرارها والاشتغال باحترافية تمكنه من منافسة المبرمجين الكبار اذا احسن استغلال الاطار بالطبع!
كما ان هذا الاطار مبني على MVC وهي [...]]]></description>
			<content:encoded><![CDATA[<p>بسم الله الرحمن الرحيم والصلاة والسلام على اشرف المرسلين اما بعد :</p>
<p>مقدمة:</p>
<p>موضوعنا اليوم وهو يعتبر  مقدمة يتحدث عن اطار العمل على لغة php المسمى بــ codeigniter والذي يسهل على المبرمج عملية كتابة الأكواد وعدم تكرارها والاشتغال باحترافية تمكنه من منافسة المبرمجين الكبار اذا احسن استغلال الاطار بالطبع!</p>
<p>كما ان هذا الاطار مبني على MVC وهي Model-View-Controller يمكنك قراءة عنه من <a href="http://forum.montadaphp.net/t953/">هنا</a></p>
<p>قبل ان تتعلم هذا الاطار العملي  يجب ان تضع في الحسبان هذأ الأمر وهو :</p>
<p>  كيفية انشاء كلاس او ما يسمى بـ البرمجة كائنية التوجه يمكنك تعلمها من  <a href="http://www.swalif.net/softs/swalif45/softs180086/">هنا</a><br />
لنعد الى الاطار وما يقدمه لك ايها المبرمج العزيز</p>
<p>codeigniter يحتوي على مكتبات واضافات ودوال تحتاجها في كامل مشارعك كذلك تستطيع اضافة مكتبات  خارجية سواء من برمجتك او اشخاص اخارون<br />
روابط الاطار تكون بهذه الطريقة http://yourSite.com/index.php/news/views/1 روابط نظيفة اليس كذالك ؟</p>
<p>ايضا تستطيع اختصارها الى http://yourSite.com/news/views/1 ببعض الأوامر البسيطة على ملف .htaccess</p>
<p>تحميل الاطار:</p>
<p>بكل سهولة على موقع codeigniter وهو www.codeigniter.com/download.php</p>
<p>كيفية تنصيب الاطار:</p>
<p>تقوم بفك الضغط على الأرشيف</p>
<p>تقوم بوضع ملفات الاطار سواءا  بمجلد انشئته او على الروت بمعنى على http://localhost/المجلد/  او http://localhost/<br />
يجب ان يكون ملف index.php بجانب مجلد system/</p>
<p>تعديلات ضرورية:</p>
<p>الأن اذهب الى الملف التالي system/application/config/config.php وقم بتغيير http://example.com الى مثلا عنوان موقعك او اذا كنت على خادم محلي اجعله http://localhost</p>
<p>كما تستطيع تعديل معلومات قاعدة البيانات من هنا system/application/config/database.php الى معلوماتك الصحيحة</p>
<p>الأن مع الأمان تستطيع تغير اسم مجلد system الى ما تشاء لكي لا يستطيع اي احد ان يعرف مكان وجود ملفاتك.....</p>
<p>وتكون عبر فتح ملف index.php وتغيير قيمة المتغير $system_folder </p>
<p>حسنا لحد الان لم تخبرنا يا عبد الواحد كيف واين سأكتب اكوادي ؟ الجواب يكون في الدرس القادم ان شاء الله </p>
<p>هذا فان اصبت فمن الله عز وجل وان اسأت فمن نفسي ومن الشيطان</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bp.ma/2010/02/05/%d9%83%d9%86-%d9%85%d8%ad%d8%aa%d8%b1%d9%81%d8%a7-%d9%81%d9%8a-%d9%84%d8%ba%d8%a9-php-%d9%85%d8%b9-%d8%a7%d8%b7%d8%a7%d8%b1-%d8%a7%d9%84%d8%b9%d9%85%d9%84-codeigniter/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>عيد مبارك سعيد</title>
		<link>http://www.bp.ma/2009/11/26/%d8%b9%d9%8a%d8%af-%d9%85%d8%a8%d8%a7%d8%b1%d9%83-%d8%b3%d8%b9%d9%8a%d8%af-2/</link>
		<comments>http://www.bp.ma/2009/11/26/%d8%b9%d9%8a%d8%af-%d9%85%d8%a8%d8%a7%d8%b1%d9%83-%d8%b3%d8%b9%d9%8a%d8%af-2/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 17:00:00 +0000</pubDate>
		<dc:creator>عبد الواحد البشيري</dc:creator>
				<category><![CDATA[غير مصنف]]></category>

		<guid isPermaLink="false">http://www.bp.ma/2009/11/26/%d8%b9%d9%8a%d8%af-%d9%85%d8%a8%d8%a7%d8%b1%d9%83-%d8%b3%d8%b9%d9%8a%d8%af-2/</guid>
		<description><![CDATA[عيد مبارك سعيد اعاده الله علينا باليمن والبركة
اتمنى لكم حياة سعيدة 
]]></description>
			<content:encoded><![CDATA[<p>عيد مبارك سعيد اعاده الله علينا باليمن والبركة</p>
<p>اتمنى لكم حياة سعيدة </p>
]]></content:encoded>
			<wfw:commentRss>http://www.bp.ma/2009/11/26/%d8%b9%d9%8a%d8%af-%d9%85%d8%a8%d8%a7%d8%b1%d9%83-%d8%b3%d8%b9%d9%8a%d8%af-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>تم نقل جميع الدروس من الاستضافة القديمة الى المجانية</title>
		<link>http://www.bp.ma/2009/11/15/%d8%aa%d9%85-%d9%86%d9%82%d9%84-%d8%ac%d9%85%d9%8a%d8%b9-%d8%a7%d9%84%d8%af%d8%b1%d9%88%d8%b3-%d9%85%d9%86-%d8%a7%d9%84%d8%a7%d8%b3%d8%aa%d8%b6%d8%a7%d9%81%d8%a9-%d8%a7%d9%84%d9%82%d8%af%d9%8a%d9%85/</link>
		<comments>http://www.bp.ma/2009/11/15/%d8%aa%d9%85-%d9%86%d9%82%d9%84-%d8%ac%d9%85%d9%8a%d8%b9-%d8%a7%d9%84%d8%af%d8%b1%d9%88%d8%b3-%d9%85%d9%86-%d8%a7%d9%84%d8%a7%d8%b3%d8%aa%d8%b6%d8%a7%d9%81%d8%a9-%d8%a7%d9%84%d9%82%d8%af%d9%8a%d9%85/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 15:09:48 +0000</pubDate>
		<dc:creator>عبد الواحد البشيري</dc:creator>
				<category><![CDATA[غير مصنف]]></category>

		<guid isPermaLink="false">http://www.bp.ma/?p=372</guid>
		<description><![CDATA[بسم الله الرحمن الرحيم
تم الانتقال من الاستضافة التي كان قد اهداها لي الأخ محمود صاحب منتدى بي اتش بي الى هذه الاستضافة المجانية وذلك رغبة مني ومن زوار المدونة بعدم ضياع الدروس التي كتبتها سابقا
وبهذا ستكون هذه المدونة موجودة الى ان يشاء الله  في متناول المتعلمين للبرمجة ... كما سأجعل الدومين www.bp.ma ينقل الزائر [...]]]></description>
			<content:encoded><![CDATA[<p>بسم الله الرحمن الرحيم</p>
<p>تم الانتقال من الاستضافة التي كان قد اهداها لي الأخ محمود صاحب منتدى بي اتش بي الى هذه الاستضافة المجانية وذلك رغبة مني ومن زوار المدونة بعدم ضياع الدروس التي كتبتها سابقا</p>
<p>وبهذا ستكون هذه المدونة موجودة الى ان يشاء الله  في متناول المتعلمين للبرمجة ... كما سأجعل الدومين www.bp.ma ينقل الزائر الى  http://elbachiri.wordpress.com حتى ينتهي في منتصف سنة 2011</p>
<p>اشكر الاخ الدرازي صادق على تصميمه لمدونتي القديمة كما اشكر اخي محمود على كل مجهوداته...</p>
<p>والسلام عليكم</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bp.ma/2009/11/15/%d8%aa%d9%85-%d9%86%d9%82%d9%84-%d8%ac%d9%85%d9%8a%d8%b9-%d8%a7%d9%84%d8%af%d8%b1%d9%88%d8%b3-%d9%85%d9%86-%d8%a7%d9%84%d8%a7%d8%b3%d8%aa%d8%b6%d8%a7%d9%81%d8%a9-%d8%a7%d9%84%d9%82%d8%af%d9%8a%d9%85/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>سيم اغلاق هذه المدونة</title>
		<link>http://www.bp.ma/2009/11/05/%d8%b3%d9%8a%d9%85-%d8%a7%d8%ba%d9%84%d8%a7%d9%82-%d9%87%d8%b0%d9%87-%d8%a7%d9%84%d9%85%d8%af%d9%88%d9%86%d8%a9/</link>
		<comments>http://www.bp.ma/2009/11/05/%d8%b3%d9%8a%d9%85-%d8%a7%d8%ba%d9%84%d8%a7%d9%82-%d9%87%d8%b0%d9%87-%d8%a7%d9%84%d9%85%d8%af%d9%88%d9%86%d8%a9/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 13:15:01 +0000</pubDate>
		<dc:creator>عبد الواحد البشيري</dc:creator>
				<category><![CDATA[القسم العام]]></category>

		<guid isPermaLink="false">http://www.bp.ma/?p=370</guid>
		<description><![CDATA[بسم الله الرحمن الرحيم
بعد مرور اكثر من اربعة شهور على عدم تجديد المدونة بالمقالات والدروس واجد نفسي مضطر الى غلقها
اشكر اخي محمود على استضافته .... كما اشكر جميع اصدقائي في هذا العالم الافتراضي
اتمنى لكم حياة سعيدة مليئة بالطاعات والخير والبركة
سيتم اغلاق المدونة بمجرد التفاهم مع اخي محمود صاحب منتدى بي اتش بي وعندها ساجعل هذا [...]]]></description>
			<content:encoded><![CDATA[<p>بسم الله الرحمن الرحيم</p>
<p>بعد مرور اكثر من اربعة شهور على عدم تجديد المدونة بالمقالات والدروس واجد نفسي مضطر الى غلقها</p>
<p>اشكر اخي محمود على استضافته .... كما اشكر جميع اصدقائي في هذا العالم الافتراضي</p>
<p>اتمنى لكم حياة سعيدة مليئة بالطاعات والخير والبركة</p>
<p>سيتم اغلاق المدونة بمجرد التفاهم مع اخي محمود صاحب منتدى بي اتش بي وعندها ساجعل هذا الدومين bp.ma ينقل الزائر مباشرة الى www.montadaphp.net</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bp.ma/2009/11/05/%d8%b3%d9%8a%d9%85-%d8%a7%d8%ba%d9%84%d8%a7%d9%82-%d9%87%d8%b0%d9%87-%d8%a7%d9%84%d9%85%d8%af%d9%88%d9%86%d8%a9/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
	</channel>
</rss>
